import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import BooksList from '../views/BooksList.vue'
import Bookinfo from '../views/BookInfo.vue'
import Cart from '../views/Cart.vue'
import PicZoom from "vue-piczoom"
import Order from "../views/Order.vue"

Vue.use(VueRouter)
Vue.use(PicZoom  )
const routes = [
        {
          path:'/books',
          name:'BooksList',
          component:BooksList
      },
  {
    path:'/',
    redirect:'/index'
  },
  {
    path:'/index',
    name:'Index',
    component:Index
  },
  {
    path:'/login',
    name:'Login',
    component:Login
  },
  {
    path:'/register',
    name:'Register',
    component:Register
  },
  {
    path:'/bookinfo',
    name:'Bookinfo',
    component:Bookinfo
  },
  {
    path:'/cart',
    name:'cart',
    component:Cart
  },
  {
    path:'/order',
    name:'Order',
    component:Order
  }

  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
